﻿//using System;
using System.Windows.Markup;
using Petra.Gis.Geometry.Support;
using Petra.Gis.ReferenceSystemServices;
using Petra.Gis.ReferenceSystemServices.Transformations;


namespace testSRST
{
  public class testXamlTransform
  {

    public static void testMe()
    {

      SRSTransform t = testBursaWolfTransform.CreateTransform_jtsk_wgs84();
      string outstr = XamlWriter.Save(t);

      SRSTransform tOut = (SRSTransform)XamlReader.Parse(outstr);

      //projection is not persistable!!
      //EquirectangularProjection pt = new EquirectangularProjection(testSRSEquirectangularProj.createProjection_32662());
      //outstr = XamlWriter.Save(pt);
      //ProjectionTransform ptOut = (ProjectionTransform)XamlReader.Parse(outstr);

      //Krovak kpt = new Krovak(testSRSJtsk.createJTSK_2065());
      //outstr = XamlWriter.Save(pt);
      //ptOut = (ProjectionTransform)XamlReader.Parse(outstr);


      //string tr;

      //    string tr = @"
      //      <Krovak>
      //
      //        <Krovak.Source>
      //          <pgrss:ProjectedCoordinateSystem>
      //            <pgrss:ProjectedCoordinateSystem.GeographicCoordinateSystem>
      //              <pgrss:GeographicCoordinateSystem>
      //                <pgrss:GeographicCoordinateSystem.PrimeMeridian>
      //                  <pgrss:PrimeMeridian Longitude='-17.4'>
      //                    <pgrss:PrimeMeridian.AngularUnit>
      //                      <pgrss:AngularUnit RadiansPerUnit='0.017453292519943295' />
      //                    </pgrss:PrimeMeridian.AngularUnit>
      //                  </pgrss:PrimeMeridian>
      //                </pgrss:GeographicCoordinateSystem.PrimeMeridian>
      //                <pgrss:GeographicCoordinateSystem.Datum>
      //                  <pgrss:HorizontalDatum>
      //                    <pgrss:HorizontalDatum.Ellipsoid>
      //                      <pgrss:Spheroid SemiMajorAxis='6377397.155' SemiMinorAxis='6356078.96284'>
      //                        <pgrss:Spheroid.AxisUnit>
      //                          <pgrss:DistanceUnit MetersPerUnit='1' />
      //                        </pgrss:Spheroid.AxisUnit>
      //                      </pgrss:Spheroid>
      //                    </pgrss:HorizontalDatum.Ellipsoid>
      //                  </pgrss:HorizontalDatum>
      //                </pgrss:GeographicCoordinateSystem.Datum>
      //                <pgrss:GeographicCoordinateSystem.Axes>
      //                  <pgrss:AxisList Capacity='4'>
      //                    <pgrss:Axis Name='E' Orientation='East' />
      //                    <pgrss:Axis Name='N' Orientation='North' />
      //                  </pgrss:AxisList>
      //                </pgrss:GeographicCoordinateSystem.Axes>
      //              </pgrss:GeographicCoordinateSystem>
      //            </pgrss:ProjectedCoordinateSystem.GeographicCoordinateSystem>
      //            <pgrss:ProjectedCoordinateSystem.Projection>
      //              <pgrss:Projection ClassName='Krovak'>
      //              </pgrss:Projection>
      //            </pgrss:ProjectedCoordinateSystem.Projection>
      //            <pgrss:ProjectedCoordinateSystem.VerticalDatum>
      //              <pgrss:VerticalDatum Type='Unspecified'>
      //                <pgrss:VerticalDatum.VerticalUnit>
      //                  <pgrss:DistanceUnit MetersPerUnit='1' />
      //                </pgrss:VerticalDatum.VerticalUnit>
      //              </pgrss:VerticalDatum>
      //            </pgrss:ProjectedCoordinateSystem.VerticalDatum>
      //            <pgrss:ProjectedCoordinateSystem.Axes>
      //              <pgrss:AxisList Capacity='4'>
      //                <pgrss:Axis Name='X' Orientation='South' />
      //                <pgrss:Axis Name='Y' Orientation='West' />
      //              </pgrss:AxisList>
      //            </pgrss:ProjectedCoordinateSystem.Axes>
      //            <pgrss:ProjectedCoordinateSystem.DefaultEnvelope>
      //              <pggs:BoundingBox Left='431680' Right='904554' Top='1227672' Bottom='935198' />
      //            </pgrss:ProjectedCoordinateSystem.DefaultEnvelope>
      //            <pgrss:ProjectedCoordinateSystem.Unit>
      //              <pgrss:DistanceUnit MetersPerUnit='1' />
      //            </pgrss:ProjectedCoordinateSystem.Unit>
      //          </pgrss:ProjectedCoordinateSystem>
      //        </Krovak.Source>
      //        <Krovak.Target>
      //          <pgrss:GeographicCoordinateSystem>
      //            <pgrss:GeographicCoordinateSystem.PrimeMeridian>
      //              <pgrss:PrimeMeridian Longitude='-17.4'>
      //                <pgrss:PrimeMeridian.AngularUnit>
      //                  <pgrss:AngularUnit RadiansPerUnit='0.017453292519943295' />
      //                </pgrss:PrimeMeridian.AngularUnit>
      //              </pgrss:PrimeMeridian>
      //            </pgrss:GeographicCoordinateSystem.PrimeMeridian>
      //            <pgrss:GeographicCoordinateSystem.Datum>
      //              <pgrss:HorizontalDatum>
      //                <pgrss:HorizontalDatum.Ellipsoid>
      //                  <pgrss:Spheroid SemiMajorAxis='6377397.155' SemiMinorAxis='6356078.96284'>
      //                    <pgrss:Spheroid.AxisUnit>
      //                      <pgrss:DistanceUnit MetersPerUnit='1' />
      //                    </pgrss:Spheroid.AxisUnit>
      //                  </pgrss:Spheroid>
      //                </pgrss:HorizontalDatum.Ellipsoid>
      //              </pgrss:HorizontalDatum>
      //            </pgrss:GeographicCoordinateSystem.Datum>
      //            <pgrss:GeographicCoordinateSystem.Axes>
      //              <pgrss:AxisList Capacity='4'>
      //                <pgrss:Axis Name='E' Orientation='East' />
      //                <pgrss:Axis Name='N' Orientation='North' />
      //              </pgrss:AxisList>
      //            </pgrss:GeographicCoordinateSystem.Axes>
      //          </pgrss:GeographicCoordinateSystem>
      //        </Krovak.Target>
      //
      //      </Krovak>
      //";

      //SRSTransform c1 = (SRSTransform)XamlReader.Parse(tr);


    }

  }
}
